package com.suhui.task.service;

import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

@Service
public class Get_header {

    private String token=null;

    /**
     * 获取token
     */
    public void get_token(String token) {
        this.token = token;
    }

    /**
     * 统一设置请求头
     */
    public Map<String,String> set_header () {
        //设置请求头
        String Authorization = "Bearer " + this.token;
        Map<String,String> header = new HashMap<>();
        header.put("Authorization",Authorization);
        return header;
    }

}
